import java.util.Stack;

public class Main {
    public static void main(String[] args) {
        MyStack myStack = new MyStack();
//        myStack.push(12);
//        myStack.push(23);
//        myStack.push(34);
//        myStack.push(45);
//
//        System.out.println(myStack.peek());
//        System.out.println(myStack.pop());
        System.out.println(myStack.isValid("{[(<>)]}"));
        String string[] = {"2","1","+","3","*"};
        System.out.println(myStack.evalRPN(string));
    }
    public static void main1(String[] args) {
        Stack<Integer> stack = new Stack<>();//初始化一个栈
        stack.push(12); //填充
        stack.push(23);
        stack.push(34);
        stack.push(45);

        Integer x = stack.pop(); //弹出最后一个填充进栈的元素（栈顶）并删除
        System.out.println(x);

        Integer x1 = stack.peek(); //显示栈顶元素但不删除
        System.out.println(x1);

        System.out.println(stack.empty()); //栈是否为空

        System.out.println(stack.size()); //栈的长度
    }
}